<?xml version="1.0" encoding="UTF-8"?>
<transfer xsi:noNamespaceSchemaLocation="/transfer/resources/xsd/transfer.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

	<!--<objectCache>
		<defaultcache>
			<scope type="none" />          
		</defaultcache>
	</objectCache>
	-->
  <objectDefinitions>
	  <package name="user">
          <object name="user" table="user" >
              <id name="user_id" type="numeric" generate="false"/>
			  <property name="username" type="string" nullable="false" />
			  <property name="password" type="string" nullable="false" />
          </object>
      </package>
	  <package name="exam">
          <object name="answer" table="answer" >
              <id name="answer_id" type="numeric" generate="false"/>
			  <property name="answer" type="string" nullable="false" />
			  <property name="question_id" type="numeric" nullable="false" />
			  <property name="is_correct" type="boolean" nullable="false" />
          </object>
          <object name="attempt" table="attempt" >
              <id name="attempt_id" type="numeric" generate="false"/>
			  <property name="is_finish" type="boolean" nullable="false" />
			  <property name="final_mark" type="numeric" nullable="false" />
			  <manytoone name="user_id">
		         <link to="user.user" column="user_id"/>
			  </manytoone>
			  <onetomany name="attempt_question">
					<link to="exam.attempt_question" column="attempt_id" />
					<collection type="struct"><key property="attempt_id" /></collection>			  
			  </onetomany>
          </object>
          <object name="attempt_question" table="attempt_question">
				<compositeid>
					<property name="attempt_id" />
             		<parentonetomany class="exam.attempt" />
					<property name="question_id" />
             		<parentonetomany class="exam.question" />
        		 </compositeid>
				 <property name="user_answer_ids" type="string" nullable="false" />
                 <property name="is_correct" type="boolean" nullable="false" />
		  </object>
          <object name="question" table="question" >
              <id name="question_id" type="numeric" generate="false"/>
			  <property name="question" type="string" nullable="false" />
			  <onetomany name="answers">
		         <link to="exam.answer" column="question_id"/>
		         <collection type="struct"><key property="question_id" /></collection>			  
			  </onetomany>
			  <onetomany name="attempt_question">
		         <link to="exam.attempt_question" column="question_id"/>
		         <collection type="struct"><key property="question_id" /></collection>			  
			  </onetomany>			  
          </object>
      </package>
  </objectDefinitions>
</transfer>